package org.fixies.spreadsheet;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * // TODO change this
 * User: Tsuyoshi
 * Date: 2010/11/03
 * Time: 20:03:41
 */
public class Section implements Element {

    private String id_;
    private Map<String, Unit> units_;
    private String inheritOrigin_;

    public Section(String id, Map<String, Unit> units, String origin) {
        id_ = id;
        units_ = units;
        inheritOrigin_ = origin;
    }

    public Unit getUnit(String id) {
        return units_.get(id);
    }

    public List<Unit> getUnits() {
        return new ArrayList<Unit>(units_.values());
    }

    public String getId() {
        return id_;
    }


    public String getOrigin() {
        return inheritOrigin_;
    }

    @Override
    public int size() {
        return units_.size();
    }
}
